//
//  EFAMsgCtrlSendTCell.m
//  efairy
//
//  Created by XiangDongMBP on 2017/7/12.
//  Copyright © 2017年 East. All rights reserved.
//

#import "EFAMsgCtrlSendTCell.h"
#import "EFAModel.h"
#import <UIImageView+WebCache.h>

@implementation EFAMsgCtrlSendTCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.portraitImgView.layer.masksToBounds = YES;
    self.portraitImgView.layer.cornerRadius = 3;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configViewWithIMItem:(EFAMsgIMItem *)item {
    self.nameLabel.text = [EFAModel sharedInstance].loginInfo.user_info.efairyuser_nickname;
    self.timeLabel.text = item.efairydevicemsg_time;
    if(item.efairydevicemsg_content && item.efairydevicemsg_content.length > 0){
         self.msgLabel.text = item.efairydevicemsg_content;
    }else{
         self.msgLabel.text = item.efairymsg_content;
    }
   
    NSString *headerImgUrl = [EFAModel sharedInstance].loginInfo.user_info.efairyuser_headimg_url;
    [self.portraitImgView sd_setImageWithURL:[NSURL URLWithString:headerImgUrl ? headerImgUrl : @""] placeholderImage:[UIImage imageNamed:@"global_portrait"]];
}

@end
